/*************************************************************************
 *                                                                       *
 * This file is part of the FreeMAPs distribution.  For full copyright   *
 * information, see COPYRIGHT and COPYING.LESSER.                        *
 *                                                                       *
 * Author:           sqbang                                              *
 * Email:            sqbang@ustc.edu                                     *
 * Date:             2012.09.06                                          *
 *                                                                       *
 *************************************************************************/

#ifndef FreeMAPs_include_COMMON_equa_EquationDomain_h
#define FreeMAPs_include_COMMON_equa_EquationDomain_h

#include "FreeMAPsConfig.h"

//SAMRAI headers
#ifdef FREEMAPS_HAVE_SAMRAI
#  include "SAMRAI/pdat/CellData.h"
#endif

//LIBMESH headers

//COMMON headers
#include "COMMON/base/StateIndicator.h"


namespace FreeMAPs
{

//forward declarations
class Function;
class PDEEquationEnsembleStrategy;
class DefaultValueOutRange;
class Region;
class PhaseChangeGroup;

/**
 * @brief use to set the range where the equation ensemble is solved.
 *
 * in structured mesh, level set will be used to describe the range.
 * in unstructured mesh, elem group will be used to describe the range.
 */
class EquationDomain : public StateIndicator
{
public:

    explicit
    EquationDomain (
        const PDEEquationEnsembleStrategy* equation_ensemble);

    virtual
    ~EquationDomain();

    void
    set_region_name(
            const std::string region_name);

    const std::string&
    get_region_name() const;

public:

    inline const PDEEquationEnsembleStrategy*
    get_equation_ensemble()const;

public:

    void
    clear();

    void
    get_from_input (
        const InputDatabase* db);

    friend std::ostream&
    operator << (
        std::ostream& os,
        const EquationDomain& rhs);


private:

    typedef StateIndicator Parent;

    const PDEEquationEnsembleStrategy* d_equation_ensemble;

    PhaseChangeGroup* d_phase_change_group;

    std::string d_region_name;

private:

    DISALLOW_COPY_AND_ASSIGN (EquationDomain);
};

}

#include "COMMON/equa/EquationDomain.inl"

#endif
